package com.bailan.foreat.mapper;

import com.bailan.foreat.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {
    @Update("update t_order set status=#{newStatus} where id=#{orderId}")
    int updateOrderStatus(Integer orderId, Integer newStatus);

    @Update("update t_item set status=#{newStatus} where id=#{itemId}")
    int updateItemStatus(Integer itemId, Integer newStatus);

    @Update("update t_item set status=#{newStatus},refund_reason=#{refundReason} where id=#{itemId}")
    int updateRefund(Integer itemId, Integer newStatus, String refundReason);
}
